<!DOCTYPE html>
<style>
  div {
    width: 500px;
    height: 500px;
    border: 1px solid black;
  }

  .container {
    perspective: 1px;
  }

  .box {
    background-color: red;
    transform:
      matrix3d(
        1, 0, 0, 0,
        0, 1, 0, 0,
        0, 0, 1, 0,
        0, 0, 0, -1
      )
      translateZ(-2px);
  }
</style>
<div class="container">
  <div class="box"></div>
</div>
